package com.rightsidetech.trade.mapper;

import com.rightsidetech.trade.dtos.request.TdCouponUsePageReq;
import com.rightsidetech.trade.dtos.response.TdCouponSumAmountStatis;
import com.rightsidetech.trade.dtos.response.TdCouponUsePageResp;
import com.rightsidetech.trade.entity.TdCouponUseRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TdCouponUseRecordMapper {
    int deleteByPrimaryKey(Long id);

    int insert(TdCouponUseRecord record);

    int insertSelective(TdCouponUseRecord record);

    TdCouponUseRecord selectByPrimaryKey(Long id);

    TdCouponUseRecord selectByCode(String code);

    int updateByPrimaryKeySelective(TdCouponUseRecord record);

    int updateByPrimaryKey(TdCouponUseRecord record);

    List<TdCouponUsePageResp> couponUsePage(TdCouponUsePageReq record);

    TdCouponUseRecord selectByOrderNo(@Param("orderNo") String orderNo);

    int delByCode(String code);

    int updateStatusByCodeAndId(@Param("code") String code,@Param("id") Long id);

    TdCouponSumAmountStatis selectSumByActivityId(@Param("activityId") Long activityId);
}